#include "BlackDeath.Core.h"

namespace BlackDeath
{
	namespace Core
	{
		#pragma region Constructors and Deconstructors
		CGameComponent::CGameComponent(CGame* game)
		{
			this->m_pGame = game;
			this->m_bEnabled = true;
		}
		CGameComponent::~CGameComponent()
		{
			this->m_pGame = NULL;
		}
		#pragma endregion

		#pragma region Methods
		void CGameComponent::Initialize()
		{
			
		}

		void CGameComponent::Update(CGameTime* gameTime)
		{

		}
		#pragma endregion

		#pragma region Options
		void CGameComponent::InternalUpdate(CGameTime* gameTime)
		{
			if(!this->m_bEnabled)
				return;

			this->Update(gameTime);
		}
		#pragma endregion

		#pragma region More_Options
		CGame* CGameComponent::Get_Game()
		{
			return this->m_pGame;
		}
		#pragma endregion

		#pragma region Properties
		bool CGameComponent::Get_Enabled()
		{
			return this->m_bEnabled;
		}
		
		void CGameComponent::Set_Enabled(bool flag)
		{
			this->m_bEnabled = flag;
		}

		BlackDeath::Graphics::CGraphicsDevice* CGameComponent::Get_GraphicsDevice()
		{
			return this->Get_Game()->Get_GraphicsDevice();
		}
		#pragma endregion
	}
}